<template>
	<view :class="[primarySize()]">
		<view class="container">
			<view class="page-head flex-box">
				<view class="tab_item flex-grow-1" :class="nindex==1?'active':''" @click="bindStatusChange(1)">人才
				</view>
				<view class="tab_item flex-grow-1" :class="nindex==0?'active':''" @click="bindStatusChange(0)">
					企业</view>

			</view>
			<view class="pt88 plr30 pb30">

				<resume-list :resumes="resumeList"></resume-list>

				<view class="nothing" v-if="resumeListMore.nothing">
					<image src="/static/public/icon_nothing.png" mode="aspectFit"></image>
					<text>暂无人才数据</text>
				</view>
				<view class="g-btn3-wrap" v-else>
					<view class="g-btn3" @click="fetchResume()">{{resumeListMore.text}}</view>
				</view>

			</view>
		</view>
	</view>
</template>

<script>
	const app = getApp();
	import resumeList from '../../components/resume-list/resume-list.vue';
	export default {
		components: {
			resumeList
		},
		data() {
			return {
				
				resumeList: [],
				resumeListMore: {
					page: 1
				},
				nindex:0
			}
		},
		onReady() {
			uni.setNavigationBarColor({
				frontColor: '#ffffff',
				backgroundColor: this.primaryColor()
			})
		},
		onLoad() {
			
			let userinfo = this.$core.getUserinfo();
			this.userinfo = userinfo;
			this.fetchResume();
		},
		onReachBottom() {
			this.fetchResume();
		},
		methods: {
			bindStatusChange(status) {
				this.nindex = status;
				this.refresh();
			},
			fetchResume() {
				this.$util.fetch(this, 'xilujob.resume/my_look', {}, 'resumeListMore', 'resumeList', 'data', 'unique');
			},
		}
	}
</script>

<style lang="scss" scoped>
	.pt88 {
		padding-top: 88rpx;
	}

	.page-head {
		height: 88rpx;
		background-color: var(--primary);

		.tab_item {
			height: 88rpx;
			line-height: 88rpx;
			text-align: center;
			font-size: 26rpx;
			color: #FFFFFF;

			&.active {
				font-weight: bold;
				font-size: 26rpx;
				color: #FFFFFF;
				position: relative;

				&::after {
					content: '';
					width: 36rpx;
					height: 6rpx;
					background: #FFFFFF;
					border-radius: 4rpx;
					position: absolute;
					bottom: 0;
					left: 50%;
					transform: translateX(-50%);
				}
			}
		}
	}

	.recomd_item {
		padding: 25rpx 30rpx 20rpx;
		width: 690rpx;
		background: #FFFFFF;
		border-radius: 18rpx;
		margin-top: 20rpx;

		.label {
			display: inline-block;
			vertical-align: top;
			height: 38rpx;
			background: #F7F7F7;
			border-radius: 4rpx;
			line-height: 38rpx;
			text-align: center;
			font-size: 20rpx;
			color: #A5A5A5;
			padding: 0 14rpx;
			margin-top: 20rpx;
			margin-right: 18rpx;
		}

		.bt {
			border-top: 1px solid #eee;
		}
	}
</style>